package com.youhome.business.controller;

import com.youhome.common.exception.CustomException;
import com.youhome.common.response.Result;
import com.youhome.common.response.ResultCode;
import com.youhome.service.service.OSSService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by chen365 on 2019/01/16.
 */
@RestController
@Api(tags = "Token")
@RequestMapping(value = "/token")
public class TokenController {

    @Autowired
    private OSSService ossService;

    @GetMapping(value = "/get-token")
    public Object getToken() throws CustomException {
        return new Result(ResultCode.SUCCESS, ossService.getVideoToken());
    }
}
